package com.yuw.homework4_2;

public class ColaEmployee {
    // 属性
    private String empName;
    private int empBirthMonth;
    private int month;

    // 行为

    public ColaEmployee(String empName, int empBirthMonth, int month) {
        this.empName = empName;
        this.empBirthMonth = empBirthMonth;
        this.month = month;
    }

    public String getEmpName() {
        return empName;
    }

    public void setEmpName(String empName) {
        this.empName = empName;
    }

    public int getEmpBirthMonth() {
        return empBirthMonth;
    }

    public void setEmpBirthMonth(int empBirthMonth) {
        this.empBirthMonth = empBirthMonth;
    }

    public int getMonth() {
        return month;
    }

    public void setMonth(int month) {
        this.month = month;
    }

    /**
     * 根据员工是否当月生日，获取生日金工资
     *
     * @return 生日金工资
     */
    public double getSalary() {
        // 返回值
        double salary = 0.0;
        // 判断是否的当月过生日，如果是，则工资为100元生日金
        if (month == empBirthMonth) {
            salary = 100;
        }
        // 返回值
        return salary;
    }

}
